/*
 * @Author: Drc
 * @Date: 2021-08-17 15:51:08
 * @LastEditTime: 2021-11-03 13:56:25
 * @LastEditors: Drc
 */

import http from '@path/utils/http'
import Api from '@path/config/api'
import store from '@path/redux'

/**
 * 常用请求封装
 */
class CommonRequest {
  static async getUserInfo() {
    const res = await http.get(Api.userInfo)
    if (res?.code === 200) {
      store.dispatch.user.updateInfo(res.data)
      return true
    } else {
      return false
    }
  }
}

export default CommonRequest
